<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>

<div class="sidebar sidebar-main sidebar-default sidebar-fixed">
	<div class="sidebar-content">
		<!-- Main navigation -->
		<div class="sidebar-category sidebar-category-visible">
			<div style="" class="category-content no-padding">
				<ul class="navigation navigation-main navigation-accordion navigation-bordered">
					<c:forEach items="${menus}" var="menu">
						<li class="navigation-header"><span>${menu.name}</span> <i class="${menu.icon}" title="${menu.title}"></i></li>
						${menu.comments}
					</c:forEach>
				</ul>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
function triggerMenuByMark(menuMark){
	var url=$.getVirtualPath()+"/admin/superbase/menu/queryMenuId?menuMark="+menuMark;
	var menuId=$.getTextPost(url);
	
	triggerMenuById(menuId)
}

function triggerMenuById(menuId){
	if($.isNull(menuId)){
		return;
	}
	//先点击自己
	var aClick=$("a.menu_click[data-menuId='"+menuId+"']");
	if(!aClick.hasClass("has_url")){return;}
	
	aClick[0].click();
	
	var depth=aClick.attr("data-depth");
	//在逐个触发父级
	var depths=resolveDepth(depth);
	$.each(depths,function(index,element){
		if($("a.menu_click[data-depth='"+element+"']").parent("li").hasClass("active")){
			return;
		}
		$("a.menu_click[data-depth='"+element+"']")[0].click();
	});
}
</script>
